Previous Book Contents Book Index Next

Inside Macintosh: /
QuickDraw 3D RAVE / QuickDraw 3D RAVE Reference
Constants


Pixel Types

The pixelType field of a memory device structure (of type TQADeviceMemory) specifies a pixel format (that is, the size and organization of the memory associated with a single pixel in a memory pixmap). You use these constants to assign a value to that field and also to parameters to the QATextureNew and QABitmapNew functions.

typedef enum TQAImagePixelType {
   kQAPixel_Alpha1            = 0,
   kQAPixel_RGB16             = 1,
   kQAPixel_ARGB16            = 2,
   kQAPixel_RGB32             = 3,
   kQAPixel_ARGB32            = 4,
   kQAPixel_CL4               = 5,
   kQAPixel_CL8               = 6
} TQAImagePixelType;
Constant descriptions

kQAPixel_Alpha1
A pixel occupies 1 bit of memory, which is interpreted as an alpha channel value. This value is relevant only for the QABitmapNew function. When a bit is 1, it is opaque and is rendered in the color passed to the QADrawBitmap function; when the bit is 0, it is completely transparent.
kQAPixel_RGB16
A pixel occupies 16 bits of memory, with the red component in bits 14 through 10, the green component in bits 9 through 5, and the blue component in bits 4 through 0. There is no per-pixel alpha channel value. As a result, the pixmap (perhaps defining a texture) is treated as opaque. (You can, however, apply transparency to the pixmap using the alpha channel values of a triangle vertex, for instance.)
kQAPixel_ARGB16
A pixel occupies 16 bits of memory, with the red component in bits 14 through 10, the green component in bits 9 through 5, and the blue component in bits 4 through 0. In addition, the pixel's alpha channel value is in bit 15. When the alpha value is 1, the pixmap is opaque; when the alpha value is 0, the pixmap is completely transparent.
kQAPixel_RGB32
A pixel occupies 32 bits of memory, with the red component in bits 23 through 16, the green component in bits 15 through 8, and the blue component in bits 7 through 0. There is no per-pixel alpha channel value. As a result, the pixmap (perhaps defining a texture) is treated as opaque. (You can, however, apply transparency to the pixmap using the alpha channel values of a triangle vertex, for instance.)
kQAPixel_ARGB32
A pixel occupies 32 bits of memory, with the red component in bits 23 through 16, the green component in bits 15 through 8, and the blue component in bits 7 through 0. In addition, the pixel's alpha channel value is in bits 31 through 24. When the alpha value is 255, the pixmap is opaque; when the alpha value is 0, the pixmap is completely transparent.
kQAPixel_CL4
A pixel value is an index into a 4-bit color lookup table. This color lookup table is always big-endian (that is, the high 4 bits affect the leftmost pixel). This pixel type is valid only as a parameter for the QATextureNew and QABitmapNew functions. Not all drawing engines support this pixel type; it is supported only when a drawing engine supports the kQAOptional_CL4 feature.
kQAPixel_CL8
A pixel value is an index into a 8-bit color lookup table. This pixel type is valid only as a parameter for the QATextureNew and QABitmapNew functions. Not all drawing engines support this pixel type; it is supported only when a drawing engine supports the kQAOptional_CL8 feature.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
28 AUG 1996